#include <header.h>

pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;

void *run(void *arg){

    pthread_mutex_lock(&lock);
    pthread_cond_wait(&cond, &lock);
    printf("thread\n");

    pthread_mutex_unlock(&lock);
    return NULL;
}



int main(int argc, char* argv[]){
    pthread_t p1, p2;
    pthread_create(&p1, NULL, run, NULL);
    pthread_create(&p2, NULL, run, NULL);

    sleep(10);
    pthread_cond_broadcast(&cond);


    pthread_join(p1, NULL);
    pthread_join(p2, NULL);
	return 0;
}